import {Component, OnInit, ViewEncapsulation} from '@angular/core';
import {AppService} from "../../app.service";
import {GlobalEvent} from "../../support/event.definition";
import {LoadComponent} from "../../support/annotation";

@Component({
  selector: '.ss-platform-login-wraper',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss'],
  encapsulation: ViewEncapsulation.None
})
@LoadComponent(GlobalEvent.ShowLogin)
export class LoginComponent implements OnInit {

  constructor(private $app: AppService) {
  }

  ngOnInit(): void {
    // 数据初始化完成
    setTimeout(() => this.$app.publish(GlobalEvent.HideLoading), 200);
  }

  submit(): void {
    this.$app.publish(GlobalEvent.ShowMain);
  }
}
